object FormInGarage: TFormInGarage
  Left = 366
  Top = 125
  Width = 498
  Height = 477
  Caption = #1042#1074#1086#1076' '#1072' '#1074#1090#1086#1087#1072#1088#1082
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnHide = FormHide
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label2: TLabel
    Left = 8
    Top = 8
    Width = 277
    Height = 19
    Caption = #1044#1086#1082#1091#1084#1077#1085#1090' '#1042#1086#1086#1076' '#1058#1057' '#1074' '#1072#1074#1090#1086#1087#1072#1088#1082
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'DejaVu Sans'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label1: TLabel
    Left = 8
    Top = 40
    Width = 121
    Height = 13
    Caption = #1044#1072#1090#1072' '#1074#1074#1086#1076#1072'  '#1074' '#1072#1074#1090#1086#1087#1072#1088#1082
    FocusControl = DBEdit1
  end
  object Label3: TLabel
    Left = 8
    Top = 80
    Width = 68
    Height = 13
    Caption = #8470' '#1076#1086#1082#1091#1084#1077#1085#1090#1072
    FocusControl = DBEdit2
  end
  object Label4: TLabel
    Left = 8
    Top = 120
    Width = 70
    Height = 13
    Caption = #1043#1086#1089' '#1085#1086#1084#1077#1088' '#1058#1057
    FocusControl = DBEdit3
  end
  object Label5: TLabel
    Left = 160
    Top = 40
    Width = 50
    Height = 13
    Caption = #1052#1072#1088#1082#1072' '#1058#1057
  end
  object Label6: TLabel
    Left = 8
    Top = 344
    Width = 18
    Height = 13
    Caption = 'VIN'
    FocusControl = DBEdit5
  end
  object Label7: TLabel
    Left = 8
    Top = 264
    Width = 42
    Height = 13
    Caption = #8470' '#1055#1058#1057
    FocusControl = DBEdit6
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label8: TLabel
    Left = 8
    Top = 168
    Width = 41
    Height = 13
    Caption = #8470' '#1057#1058#1057
    FocusControl = DBEdit7
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'MS Sans Serif'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label9: TLabel
    Left = 296
    Top = 80
    Width = 124
    Height = 13
    Caption = #1043#1058#1054' '#1076#1077#1081#1089#1090#1074#1080#1090#1077#1083#1100#1085#1086' '#1076#1086'...'
  end
  object Label10: TLabel
    Left = 160
    Top = 120
    Width = 92
    Height = 13
    Caption = #8470' '#1076#1086#1082#1091#1084#1077#1085#1090#1072' '#1043#1058#1054
    FocusControl = DBEdit9
  end
  object Label11: TLabel
    Left = 296
    Top = 160
    Width = 139
    Height = 13
    Caption = #1054#1057#1040#1043#1054' '#1076#1077#1081#1089#1090#1074#1080#1090#1077#1083#1100#1085#1086' '#1076#1086'...'
  end
  object Label12: TLabel
    Left = 160
    Top = 200
    Width = 110
    Height = 13
    Caption = #8470' '#1089#1090#1088#1072#1093#1086#1074#1086#1075#1086' '#1087#1086#1083#1080#1089#1072
    FocusControl = DBEdit10
  end
  object Label13: TLabel
    Left = 160
    Top = 80
    Width = 120
    Height = 13
    Caption = #1044#1072#1090#1072' '#1087#1088#1086#1093#1086#1078#1076#1077#1085#1080#1103' '#1043#1058#1054
  end
  object Label14: TLabel
    Left = 160
    Top = 160
    Width = 104
    Height = 13
    Caption = #1044#1072#1090#1072' '#1087#1086#1083#1080#1089#1072' '#1054#1057#1040#1043#1054
  end
  object Label15: TLabel
    Left = 8
    Top = 208
    Width = 50
    Height = 13
    Caption = #1044#1072#1090#1072' '#1057#1058#1057
    FocusControl = DBEdit7
  end
  object Label16: TLabel
    Left = 8
    Top = 304
    Width = 51
    Height = 13
    Caption = #1044#1072#1090#1072' '#1055#1058#1057
    FocusControl = DBEdit7
  end
  object DBEdit1: TDBEdit
    Left = 8
    Top = 56
    Width = 129
    Height = 21
    DataField = 'DATE_DOC'
    DataSource = DataSourceHead
    TabOrder = 0
  end
  object DBEdit2: TDBEdit
    Left = 8
    Top = 96
    Width = 129
    Height = 21
    DataField = 'NUM_DOC'
    DataSource = DataSourceHead
    TabOrder = 1
  end
  object DBEdit3: TDBEdit
    Left = 8
    Top = 136
    Width = 129
    Height = 21
    DataField = 'NUM_BODY'
    DataSource = DataSourceBus
    TabOrder = 2
  end
  object DBEdit5: TDBEdit
    Left = 8
    Top = 280
    Width = 129
    Height = 21
    DataField = 'VIN'
    DataSource = DataSourceBus
    TabOrder = 3
  end
  object DBEdit6: TDBEdit
    Left = 8
    Top = 360
    Width = 129
    Height = 21
    DataField = 'NUM_VR'
    DataSource = DataSourceBus
    TabOrder = 4
  end
  object DBEdit7: TDBEdit
    Left = 8
    Top = 184
    Width = 129
    Height = 21
    DataField = 'NUM_TS'
    DataSource = DataSourceBus
    TabOrder = 5
  end
  object ButtonSave: TButton
    Left = 24
    Top = 400
    Width = 97
    Height = 25
    Caption = #1057#1086#1093#1088#1072#1085#1080#1090#1100
    TabOrder = 6
    OnClick = ButtonSaveClick
  end
  object Button2: TButton
    Left = 128
    Top = 400
    Width = 105
    Height = 25
    Caption = #1054#1090#1084#1077#1085#1072
    TabOrder = 7
    OnClick = Button2Click
  end
  object DBEdit9: TDBEdit
    Left = 160
    Top = 136
    Width = 137
    Height = 21
    DataField = 'NUM_DOC'
    DataSource = DataSourceService
    TabOrder = 8
  end
  object DBLookupComboBox1: TDBLookupComboBox
    Left = 160
    Top = 56
    Width = 137
    Height = 21
    DataField = 'f_name_models'
    DataSource = DataSourceBus
    TabOrder = 9
  end
  object DBEdit10: TDBEdit
    Left = 160
    Top = 216
    Width = 137
    Height = 21
    DataField = 'NUM_DOC'
    DataSource = DataSourceInsurance
    TabOrder = 10
  end
  object dt_service: TDateTimePicker
    Left = 296
    Top = 96
    Width = 89
    Height = 21
    CalAlignment = dtaLeft
    Date = 41568.6314381481
    Time = 41568.6314381481
    DateFormat = dfShort
    DateMode = dmComboBox
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    Kind = dtkDate
    ParseInput = False
    ParentFont = False
    TabOrder = 11
  end
  object dt_insurance: TDateTimePicker
    Left = 296
    Top = 176
    Width = 89
    Height = 21
    CalAlignment = dtaLeft
    Date = 41568.6324795833
    Time = 41568.6324795833
    DateFormat = dfShort
    DateMode = dmComboBox
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    Kind = dtkDate
    ParseInput = False
    ParentFont = False
    TabOrder = 12
  end
  object dt_doc_service: TDateTimePicker
    Left = 160
    Top = 96
    Width = 89
    Height = 21
    CalAlignment = dtaLeft
    Date = 41568.6376066667
    Time = 41568.6376066667
    DateFormat = dfShort
    DateMode = dmComboBox
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    Kind = dtkDate
    ParseInput = False
    ParentFont = False
    TabOrder = 13
    OnChange = dt_doc_serviceChange
  end
  object dt_doc_insurance: TDateTimePicker
    Left = 160
    Top = 176
    Width = 89
    Height = 21
    CalAlignment = dtaLeft
    Date = 41568.6394726505
    Time = 41568.6394726505
    DateFormat = dfShort
    DateMode = dmComboBox
    Kind = dtkDate
    ParseInput = False
    TabOrder = 14
    OnChange = dt_doc_insuranceChange
  end
  object date_ts: TDateTimePicker
    Left = 8
    Top = 224
    Width = 89
    Height = 21
    CalAlignment = dtaLeft
    Date = 41572.6150774306
    Time = 41572.6150774306
    DateFormat = dfShort
    DateMode = dmComboBox
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    Kind = dtkDate
    ParseInput = False
    ParentFont = False
    TabOrder = 15
  end
  object date_vr: TDateTimePicker
    Left = 8
    Top = 320
    Width = 89
    Height = 21
    CalAlignment = dtaLeft
    Date = 41572.6202253819
    Time = 41572.6202253819
    DateFormat = dfShort
    DateMode = dmComboBox
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -12
    Font.Name = 'MS Sans Serif'
    Font.Style = []
    Kind = dtkDate
    ParseInput = False
    ParentFont = False
    TabOrder = 16
  end
  object ds_bus: TpFIBDataSet
    UpdateSQL.Strings = (
      ''
      '    ')
    DeleteSQL.Strings = (
      '')
    InsertSQL.Strings = (
      '')
    RefreshSQL.Strings = (
      '')
    SelectSQL.Strings = (
      'select '
      '    bus.id as id_bus,'
      '    bus.id_models,'
      '    bus.num_body,'
      '    models.name_models,'
      '    bus.vin,'
      '    bus.num_vr,'
      '    bus.date_vr,'
      '    bus.num_ts,'
      '    bus.date_ts,'
      'bus.id_head_insurance,'
      'bus.id_head_state,bus.id_head_service,'
      'case when bus.id_state is null then -1'
      'else bus.id_state end as id_state_null,'
      'bus.id_state'
      'from bus'
      '   inner join models on (bus.id_models = models.id)'
      'where bus.id=:Pid_bus')
    AutoUpdateOptions.UpdateTableName = 'BUS'
    AutoUpdateOptions.KeyFields = 'ID_BUS'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    AutoUpdateOptions.GeneratorName = 'GEN_BUS_ID'
    AutoUpdateOptions.WhenGetGenID = wgOnNewRecord
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    UpdateTransaction = DataModule_tms.TransactionWrite
    Left = 368
    Top = 248
    object ds_busID_BUS: TFIBBCDField
      FieldName = 'ID_BUS'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_MODELS: TFIBBCDField
      FieldName = 'ID_MODELS'
      Size = 0
      RoundByScale = True
    end
    object ds_busNUM_BODY: TFIBStringField
      FieldName = 'NUM_BODY'
      EmptyStrToNull = True
    end
    object ds_busNAME_MODELS: TFIBStringField
      FieldName = 'NAME_MODELS'
      Size = 100
      EmptyStrToNull = True
    end
    object ds_busVIN: TFIBStringField
      FieldName = 'VIN'
      EmptyStrToNull = True
    end
    object ds_busNUM_VR: TFIBStringField
      FieldName = 'NUM_VR'
      Size = 50
      EmptyStrToNull = True
    end
    object ds_busDATE_VR: TFIBDateField
      FieldName = 'DATE_VR'
    end
    object ds_busNUM_TS: TFIBStringField
      FieldName = 'NUM_TS'
      Size = 50
      EmptyStrToNull = True
    end
    object ds_busDATE_TS: TFIBDateField
      FieldName = 'DATE_TS'
    end
    object ds_busID_HEAD_STATE: TFIBBCDField
      FieldName = 'ID_HEAD_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_STATE: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_STATE_NULL: TFIBBCDField
      FieldName = 'ID_STATE_NULL'
      Size = 0
      RoundByScale = True
    end
    object ds_busID_HEAD_SERVICE: TFIBBCDField
      FieldName = 'ID_HEAD_SERVICE'
      Size = 0
      RoundByScale = True
    end
    object ds_busf_name_models: TStringField
      FieldKind = fkLookup
      FieldName = 'f_name_models'
      LookupDataSet = pFIBDataSetModels
      LookupKeyFields = 'ID'
      LookupResultField = 'NAME_MODELS'
      KeyFields = 'ID_MODELS'
      Size = 50
      Lookup = True
    end
    object ds_busID_HEAD_INSURANCE: TFIBBCDField
      FieldName = 'ID_HEAD_INSURANCE'
      Size = 0
      RoundByScale = True
    end
  end
  object DataSourceBus: TDataSource
    DataSet = ds_bus
    Left = 408
    Top = 248
  end
  object ds_head: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    PARENT_ID_HEAD,'
      '    DATE_DOC,'
      '    NUM_DOC,'
      '    DATE_SAVE_DOC,'
      '    ID_STATE,'
      '    ID_BUS,'
      '    ID_ROUTE,'
      '    DATE_START_STATE,'
      '    DATE_END_STATE,'
      '    ID_TYPE_DOC,'
      '    DATE_START_DOC,'
      '    DATE_END_DOC,'
      '    ID_PERSONAL_MEDIC,'
      '    ID_PERSONAL_DRIVER,'
      '    ID_PERSONAL_MECHANIC'
      'FROM'
      '    HEAD '
      'where id=:Pid_head')
    AutoUpdateOptions.UpdateTableName = 'HEAD'
    AutoUpdateOptions.KeyFields = 'ID'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    AutoUpdateOptions.GeneratorName = 'GEN_HEAD_ID'
    AutoUpdateOptions.WhenGetGenID = wgOnNewRecord
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    UpdateTransaction = DataModule_tms.TransactionWrite
    Left = 368
    Top = 288
    object ds_headID: TFIBBCDField
      FieldName = 'ID'
      Size = 0
      RoundByScale = True
    end
    object ds_headPARENT_ID_HEAD: TFIBBCDField
      FieldName = 'PARENT_ID_HEAD'
      Size = 0
      RoundByScale = True
    end
    object ds_headDATE_DOC: TFIBDateField
      FieldName = 'DATE_DOC'
    end
    object ds_headNUM_DOC: TFIBStringField
      FieldName = 'NUM_DOC'
      EmptyStrToNull = True
    end
    object ds_headDATE_SAVE_DOC: TFIBDateTimeField
      FieldName = 'DATE_SAVE_DOC'
    end
    object ds_headID_STATE: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_BUS: TFIBBCDField
      FieldName = 'ID_BUS'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_ROUTE: TFIBBCDField
      FieldName = 'ID_ROUTE'
      Size = 0
      RoundByScale = True
    end
    object ds_headDATE_START_STATE: TFIBDateTimeField
      FieldName = 'DATE_START_STATE'
    end
    object ds_headDATE_END_STATE: TFIBDateTimeField
      FieldName = 'DATE_END_STATE'
    end
    object ds_headID_TYPE_DOC: TFIBBCDField
      FieldName = 'ID_TYPE_DOC'
      Size = 0
      RoundByScale = True
    end
    object ds_headDATE_START_DOC: TFIBDateTimeField
      FieldName = 'DATE_START_DOC'
    end
    object ds_headDATE_END_DOC: TFIBDateTimeField
      FieldName = 'DATE_END_DOC'
    end
    object ds_headID_PERSONAL_MEDIC: TFIBBCDField
      FieldName = 'ID_PERSONAL_MEDIC'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_PERSONAL_DRIVER: TFIBBCDField
      FieldName = 'ID_PERSONAL_DRIVER'
      Size = 0
      RoundByScale = True
    end
    object ds_headID_PERSONAL_MECHANIC: TFIBBCDField
      FieldName = 'ID_PERSONAL_MECHANIC'
      Size = 0
      RoundByScale = True
    end
  end
  object DataSourceHead: TDataSource
    DataSet = ds_head
    Left = 408
    Top = 288
  end
  object ds_head_service: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    PARENT_ID_HEAD,'
      '    DATE_DOC,'
      '    NUM_DOC,'
      '    DATE_SAVE_DOC,'
      '    ID_STATE,'
      '    ID_BUS,'
      '    ID_ROUTE,'
      '    DATE_START_STATE,'
      '    DATE_END_STATE,'
      '    ID_TYPE_DOC,'
      '    DATE_START_DOC,'
      '    DATE_END_DOC,'
      '    ID_PERSONAL_MEDIC,'
      '    ID_PERSONAL_DRIVER,'
      '    ID_PERSONAL_MECHANIC,'
      '    NOTE,'
      '    MILEAGE,'
      '    REMARK'
      'FROM'
      '    HEAD '
      'where id=:p_id_head_service')
    AutoUpdateOptions.UpdateTableName = 'HEAD'
    AutoUpdateOptions.KeyFields = 'ID'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    AutoUpdateOptions.GeneratorName = 'GEN_HEAD_ID'
    AutoUpdateOptions.WhenGetGenID = wgOnNewRecord
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    UpdateTransaction = DataModule_tms.TransactionWrite
    Left = 368
    Top = 216
    object ds_head_serviceID: TFIBBCDField
      FieldName = 'ID'
      Size = 0
      RoundByScale = True
    end
    object ds_head_servicePARENT_ID_HEAD: TFIBBCDField
      FieldName = 'PARENT_ID_HEAD'
      Size = 0
      RoundByScale = True
    end
    object ds_head_serviceDATE_DOC: TFIBDateField
      FieldName = 'DATE_DOC'
    end
    object ds_head_serviceNUM_DOC: TFIBStringField
      FieldName = 'NUM_DOC'
      EmptyStrToNull = True
    end
    object ds_head_serviceDATE_SAVE_DOC: TFIBDateTimeField
      FieldName = 'DATE_SAVE_DOC'
    end
    object ds_head_serviceID_STATE: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object ds_head_serviceID_BUS: TFIBBCDField
      FieldName = 'ID_BUS'
      Size = 0
      RoundByScale = True
    end
    object ds_head_serviceMILEAGE: TFIBBCDField
      FieldName = 'MILEAGE'
      Size = 0
      RoundByScale = True
    end
    object ds_head_serviceDATE_START_DOC: TFIBDateTimeField
      FieldName = 'DATE_START_DOC'
      DisplayFormat = 'dd.mm.yyyy'
      EditMask = 'dd.mm.yyyy'
    end
  end
  object DataSourceService: TDataSource
    DataSet = ds_head_service
    Left = 408
    Top = 216
  end
  object pFIBDataSetModels: TpFIBDataSet
    CachedUpdates = True
    SelectSQL.Strings = (
      'select * from models')
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    Left = 456
    Top = 224
  end
  object ds_head_insurance: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    PARENT_ID_HEAD,'
      '    DATE_DOC,'
      '    NUM_DOC,'
      '    DATE_SAVE_DOC,'
      '    ID_STATE,'
      '    ID_BUS,'
      '    ID_ROUTE,'
      '    DATE_START_STATE,'
      '    DATE_END_STATE,'
      '    ID_TYPE_DOC,'
      '    DATE_START_DOC,'
      '    DATE_END_DOC,'
      '    ID_PERSONAL_MEDIC,'
      '    ID_PERSONAL_DRIVER,'
      '    ID_PERSONAL_MECHANIC,'
      '    NOTE,'
      '    MILEAGE,'
      '    REMARK'
      'FROM'
      '    HEAD '
      'where id=:p_id_head_insurance')
    AutoUpdateOptions.UpdateTableName = 'HEAD'
    AutoUpdateOptions.KeyFields = 'ID'
    AutoUpdateOptions.AutoReWriteSqls = True
    AutoUpdateOptions.CanChangeSQLs = True
    AutoUpdateOptions.GeneratorName = 'GEN_HEAD_ID'
    AutoUpdateOptions.WhenGetGenID = wgOnNewRecord
    Transaction = DataModule_tms.pFIBTransaction_tms
    Database = DataModule_tms.pFIBDatabase_tms
    UpdateTransaction = DataModule_tms.TransactionWrite
    Left = 368
    Top = 328
    object FIBBCDField1: TFIBBCDField
      FieldName = 'ID'
      Size = 0
      RoundByScale = True
    end
    object FIBBCDField2: TFIBBCDField
      FieldName = 'PARENT_ID_HEAD'
      Size = 0
      RoundByScale = True
    end
    object FIBDateField1: TFIBDateField
      FieldName = 'DATE_DOC'
    end
    object FIBStringField1: TFIBStringField
      FieldName = 'NUM_DOC'
      EmptyStrToNull = True
    end
    object FIBDateTimeField1: TFIBDateTimeField
      FieldName = 'DATE_SAVE_DOC'
    end
    object FIBBCDField3: TFIBBCDField
      FieldName = 'ID_STATE'
      Size = 0
      RoundByScale = True
    end
    object FIBBCDField4: TFIBBCDField
      FieldName = 'ID_BUS'
      Size = 0
      RoundByScale = True
    end
    object FIBBCDField5: TFIBBCDField
      FieldName = 'MILEAGE'
      Size = 0
      RoundByScale = True
    end
    object ds_head_insuranceDATE_START_DOC: TFIBDateTimeField
      FieldName = 'DATE_START_DOC'
      DisplayFormat = 'dd.mm.yyyy'
      EditMask = '!99/99/0000;1;_'
    end
  end
  object DataSourceInsurance: TDataSource
    DataSet = ds_head_insurance
    Left = 408
    Top = 328
  end
end
